Skip to content

feat: add implementation of stats/base/dists/wald/kurtosis#10216

Merged
Planeshifter merged 4 commits intostdlib-js:developfrom
bhargava-d16:feat-dists-wald-kurtosis
Feb 14, 2026
Merged

feat: add implementation of stats/base/dists/wald/kurtosis#10216
Planeshifter merged 4 commits intostdlib-js:developfrom
bhargava-d16:feat-dists-wald-kurtosis

Conversation

@bhargava-d16
Copy link
Contributor


type: pre_commit_static_analysis_report
description: Results of running static analysis checks when committing changes. report:

  • task: lint_filenames status: passed
  • task: lint_editorconfig status: passed
  • task: lint_markdown status: passed
  • task: lint_package_json status: passed
  • task: lint_repl_help status: passed
  • task: lint_javascript_src status: passed
  • task: lint_javascript_cli status: na
  • task: lint_javascript_examples status: passed
  • task: lint_javascript_tests status: passed
  • task: lint_javascript_benchmarks status: passed
  • task: lint_python status: na
  • task: lint_r status: na
  • task: lint_c_src status: missing_dependencies
  • task: lint_c_examples status: missing_dependencies
  • task: lint_c_benchmarks status: missing_dependencies
  • task: lint_c_tests_fixtures status: na
  • task: lint_shell status: na
  • task: lint_typescript_declarations status: passed
  • task: lint_typescript_tests status: passed
  • task: lint_license_headers status: passed ---

Progresses #209

Description

What is the purpose of this pull request?

This pull request:

  • adds an implementation of the kurtosis for the Wald (Inverse Gaussian) distribution.

Related Issues

Does this pull request have any related issues?

This pull request has the following related issues:

Questions

Any questions for reviewers of this pull request?

No.

Other

Any other information relevant to this pull request? This may include screenshots, references, and/or implementation notes.

No.

Checklist

Please ensure the following tasks are completed before submitting this pull request.

AI Assistance

When authoring the changes proposed in this PR, did you use any kind of AI assistance?

  • Yes
  • No

If you answered "yes" above, how did you use AI assistance?

  • Code generation (e.g., when writing an implementation or fixing a bug)
  • Test/benchmark generation
  • Documentation (including examples)
  • Research and understanding

Disclosure

If you answered "yes" to using AI assistance, please provide a short disclosure indicating how you used AI assistance. This helps reviewers determine how much scrutiny to apply when reviewing your contribution. Example disclosures: "This PR was written primarily by Claude Code." or "I consulted ChatGPT to understand the codebase, but the proposed changes were fully authored manually by myself.".


@stdlib-js/reviewers

Signed-off-by: Bhargav Dabhade <bhargava2005dabhade@gmail.com>

---
type: pre_commit_static_analysis_report
description: Results of running static analysis checks when committing changes.
report:
  - task: lint_filenames
    status: passed
  - task: lint_editorconfig
    status: passed
  - task: lint_markdown
    status: passed
  - task: lint_package_json
    status: passed
  - task: lint_repl_help
    status: passed
  - task: lint_javascript_src
    status: passed
  - task: lint_javascript_cli
    status: na
  - task: lint_javascript_examples
    status: passed
  - task: lint_javascript_tests
    status: passed
  - task: lint_javascript_benchmarks
    status: passed
  - task: lint_python
    status: na
  - task: lint_r
    status: na
  - task: lint_c_src
    status: missing_dependencies
  - task: lint_c_examples
    status: missing_dependencies
  - task: lint_c_benchmarks
    status: missing_dependencies
  - task: lint_c_tests_fixtures
    status: na
  - task: lint_shell
    status: na
  - task: lint_typescript_declarations
    status: passed
  - task: lint_typescript_tests
    status: passed
  - task: lint_license_headers
    status: passed
---
@stdlib-bot stdlib-bot added Statistics Issue or pull request related to statistical functionality. Needs Review A pull request which needs code review. labels Feb 11, 2026
@stdlib-bot
Copy link
Contributor

stdlib-bot commented Feb 11, 2026

Coverage Report

Package Statements Branches Functions Lines
stats/base/dists/wald/kurtosis $\color{green}184/184$
$\color{green}+0.00%$
$\color{green}10/10$
$\color{green}+0.00%$
$\color{green}2/2$
$\color{green}+0.00%$
$\color{green}184/184$
$\color{green}+0.00%$

The above coverage report was generated for the changes in this PR.

Copy link
Member

@Planeshifter Planeshifter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for opening this PR!


The [excess kurtosis][kurtosis] for a [Wald][wald-distribution] random variable with mean `μ` and shape parameter `λ > 0` is

<!-- <equation class="equation" label="eq:wald_expectation" align="center" raw="\mathop{\mathrm{Kurt}}\left( X \right) = \frac{15\mu}{\lambda}" alt="Expected value for a Wald distribution."> -->
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this equation label and alt text were carried over from the wald/mean package. The label should reference kurtosis, not expectation.

Suggested change
<!-- <equation class="equation" label="eq:wald_expectation" align="center" raw="\mathop{\mathrm{Kurt}}\left( X \right) = \frac{15\mu}{\lambda}" alt="Expected value for a Wald distribution."> -->
<!-- <equation class="equation" label="eq:wald_kurtosis" align="center" raw="\mathop{\mathrm{Kurt}}\left( X \right) = \frac{15\mu}{\lambda}" alt="Excess kurtosis for a Wald distribution."> -->

\mathop{\mathrm{Kurt}}\left( X \right) = \frac{15\mu}{\lambda}
```

<!-- <div class="equation" align="center" data-raw-text="\mathop{\mathrm{Kurt}}\left( X \right) = \frac{15\mu}{\lambda}" data-equation="eq:wald_expectation">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same copy-paste issue here — should reference kurtosis, not expectation.

Suggested change
<!-- <div class="equation" align="center" data-raw-text="\mathop{\mathrm{Kurt}}\left( X \right) = \frac{15\mu}{\lambda}" data-equation="eq:wald_expectation">
<!-- <div class="equation" align="center" data-raw-text="\mathop{\mathrm{Kurt}}\left( X \right) = \frac{15\mu}{\lambda}" data-equation="eq:wald_kurtosis">


#### kurtosis( mu, lambda )

Returns the [excess kurtosis][kurtosis] for a [Wald][wald-distribution] with parameters mu (mean) and lambda (shape parameter).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple of small things here: there's a double space after "the", the word "distribution" is missing after the Wald link, and mu/lambda should be in backticks. Compare with wald/mean's README:

Suggested change
Returns the [excess kurtosis][kurtosis] for a [Wald][wald-distribution] with parameters mu (mean) and lambda (shape parameter).
Returns the [excess kurtosis][kurtosis] for a [Wald][wald-distribution] distribution with parameters `mu` (mean) and `lambda` (shape parameter).


#### stdlib_base_dists_wald_kurtosis( mu, lambda )

Returns the [excess kurtosis][kurtosis] for a [Wald][wald-distribution] with parameters mu (mean) and lambda (shape parameter).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same issues as line 58 — double space, missing "distribution", and missing backticks around parameter names. For the C API description, the pattern from wald/mean is slightly different (uses "with mean mu and shape parameter lambda"):

Suggested change
Returns the [excess kurtosis][kurtosis] for a [Wald][wald-distribution] with parameters mu (mean) and lambda (shape parameter).
Returns the [excess kurtosis][kurtosis] for a [Wald][wald-distribution] distribution with mean `mu` and shape parameter `lambda`.

t.end();
});

tape( 'the function returns the expected value of a Wald distribution', function test( t ) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This description was carried over from wald/mean — should say "excess kurtosis" instead of "expected value".

Suggested change
tape( 'the function returns the expected value of a Wald distribution', function test( t ) {
tape( 'the function returns the excess kurtosis of a Wald distribution', function test( t ) {

t.end();
});

tape( 'the function returns the expected value of a Wald distribution', opts, function test( t ) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same copy-paste issue as in test.js — should say "excess kurtosis" instead of "expected value".

Suggested change
tape( 'the function returns the expected value of a Wald distribution', opts, function test( t ) {
tape( 'the function returns the excess kurtosis of a Wald distribution', opts, function test( t ) {

@Planeshifter Planeshifter added Needs Changes Pull request which needs changes before being merged. and removed Needs Review A pull request which needs code review. labels Feb 12, 2026
---
type: pre_commit_static_analysis_report
description: Results of running static analysis checks when committing changes.
report:
  - task: lint_filenames
    status: passed
  - task: lint_editorconfig
    status: passed
  - task: lint_markdown
    status: passed
  - task: lint_package_json
    status: na
  - task: lint_repl_help
    status: na
  - task: lint_javascript_src
    status: na
  - task: lint_javascript_cli
    status: na
  - task: lint_javascript_examples
    status: na
  - task: lint_javascript_tests
    status: passed
  - task: lint_javascript_benchmarks
    status: na
  - task: lint_python
    status: na
  - task: lint_r
    status: na
  - task: lint_c_src
    status: na
  - task: lint_c_examples
    status: na
  - task: lint_c_benchmarks
    status: na
  - task: lint_c_tests_fixtures
    status: na
  - task: lint_shell
    status: na
  - task: lint_typescript_declarations
    status: passed
  - task: lint_typescript_tests
    status: na
  - task: lint_license_headers
    status: passed
---
@stdlib-bot stdlib-bot added the Needs Review A pull request which needs code review. label Feb 12, 2026
@bhargava-d16
Copy link
Contributor Author

@Planeshifter I have made the requested changes. Please let me know if there are any further changes to be made


> [Wald][wald-distribution] distribution [excess kurtosis][kurtosis].

!-- Section to include introductory text. Make sure to keep an empty line after the intro `section` element and another before the `/section` close. -->
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like the opening < got dropped from this HTML comment, so it'll render as visible text in the README instead of being hidden.

Suggested change
!-- Section to include introductory text. Make sure to keep an empty line after the intro `section` element and another before the `/section` close. -->
<!-- Section to include introductory text. Make sure to keep an empty line after the intro `section` element and another before the `/section` close. -->


#### stdlib_base_dists_wald_kurtosis( mu, lambda )

Returns the [excess kurtosis][kurtosis] for a [Wald][wald-distribution] distribution with parameters mean `mu` and shape parameter `lambda`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's still a double space between "with" and "parameters" here. Let's do:

Suggested change
Returns the [excess kurtosis][kurtosis] for a [Wald][wald-distribution] distribution with parameters mean `mu` and shape parameter `lambda`.
Returns the [excess kurtosis][kurtosis] for a [Wald][wald-distribution] distribution with mean `mu` and shape parameter `lambda`.

@Planeshifter Planeshifter removed the Needs Review A pull request which needs code review. label Feb 13, 2026
---
type: pre_commit_static_analysis_report
description: Results of running static analysis checks when committing changes.
report:
  - task: lint_filenames
    status: passed
  - task: lint_editorconfig
    status: passed
  - task: lint_markdown
    status: passed
  - task: lint_package_json
    status: na
  - task: lint_repl_help
    status: na
  - task: lint_javascript_src
    status: na
  - task: lint_javascript_cli
    status: na
  - task: lint_javascript_examples
    status: na
  - task: lint_javascript_tests
    status: na
  - task: lint_javascript_benchmarks
    status: na
  - task: lint_python
    status: na
  - task: lint_r
    status: na
  - task: lint_c_src
    status: na
  - task: lint_c_examples
    status: na
  - task: lint_c_benchmarks
    status: na
  - task: lint_c_tests_fixtures
    status: na
  - task: lint_shell
    status: na
  - task: lint_typescript_declarations
    status: passed
  - task: lint_typescript_tests
    status: na
  - task: lint_license_headers
    status: passed
---
@stdlib-bot stdlib-bot added the Needs Review A pull request which needs code review. label Feb 13, 2026
Signed-off-by: Philipp Burckhardt <pburckhardt@outlook.com>
Copy link
Member

@Planeshifter Planeshifter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@Planeshifter Planeshifter added the Ready To Merge A pull request which is ready to be merged. label Feb 14, 2026
@stdlib-bot stdlib-bot removed Needs Review A pull request which needs code review. Needs Changes Pull request which needs changes before being merged. labels Feb 14, 2026
@stdlib-bot
Copy link
Contributor

PR Commit Message

feat: add implementation of `stats/base/dists/wald/kurtosis`

PR-URL: https://github.com/stdlib-js/stdlib/pull/10216
Ref: https://github.com/stdlib-js/stdlib/issues/209

Co-authored-by: Philipp Burckhardt <pburckhardt@outlook.com>
Reviewed-by: Philipp Burckhardt <pburckhardt@outlook.com>
Signed-off-by: Bhargav Dabhade <bhargava2005dabhade@gmail.com>
Signed-off-by: Philipp Burckhardt <pburckhardt@outlook.com>

Please review the above commit message and make any necessary adjustments.

@Planeshifter Planeshifter merged commit 3088f39 into stdlib-js:develop Feb 14, 2026
32 checks passed
@stdlib-bot stdlib-bot removed the Ready To Merge A pull request which is ready to be merged. label Feb 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Statistics Issue or pull request related to statistical functionality.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants